# user：hp
# web自动化阶段 2022/6/2
# 时间 21:57
import pytest

from utility.log_ import GetLog
from utility.mysql_api import MysqlApi
from dustbin.read_data import ReadData

logger = GetLog.get_logger()
@pytest.fixture(scope="class", autouse=True, name="pre_class")
def login_pre():
    # 清除中间值上次储存的数据
    ReadData.yaml_clear()
    yield
    try:
        # 处理脏数据
        mysql = MysqlApi()
        mysql.uid("DELETE FROM bs_user WHERE username='王金龙'")
        logger.info("脏数据处理成功")
    except Exception as e:
        logger.error("脏数据处理失败：{}".format(e))


